package airplane.com.example.mapper;

import airplane.com.example.entry.Airplane;
import airplane.com.example.entry.Ticket;
import airplane.com.example.entry.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface TicketMapper {
    int insertTicket(Ticket ticket);
    int deleteTicketByAirplane(Ticket ticket);
    int deleteTicketAllByUser(User user);
    int deleteTicketAllByAirplane(String airplane);
    List<Ticket> queryByName(String user);

    // 分页查询
    List<Ticket> findByPage(@Param("start") Integer currentPage,
                            @Param("end") Integer pageSize,
                            @Param("user") String user);

    // 查询总页数
    int findTotal();
}
